package com.gz.dto;

import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;
import com.gz.utils.DataFmtUtil;

/**
 * 学生答卷统计表(Answers)实体参数类
 *
 * @author jhk
 * @since 2024-09-05 14:44:59
 */
@Data
@ApiModel("用户答题实体参数类")
public class AnswersDto extends PageInfoDto implements Serializable {
    private static final long serialVersionUID = -56362457193084076L;
    @ApiModelProperty("答卷统id")
    private Integer answerId;
    @ApiModelProperty("答题用户id")
    private Integer userId;
    @ApiModelProperty("答题用户名")
    private String username;
    @ApiModelProperty("关联试卷id")
    private Integer examId;
    @ApiModelProperty("提交时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date submitTime;
    @ApiModelProperty("该题目分值")
    private Double totalScore;
    @ApiModelProperty("学生答题答案")
    private String questionAnswer;
    @ApiModelProperty("试卷名字")
    private String paperName;
    @ApiModelProperty("创建人id")
    private String createId;
    @ApiModelProperty("创建试卷教师姓名")
    private String creatTeacher;
    @ApiModelProperty("排序字段")
    private String orderField;
    @ApiModelProperty("排序类型")
    private String orderType;
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date crtDt;

    public String getOrderField() {
        if (!StringUtils.isEmpty(orderField)) {
            return DataFmtUtil.xX2x_x(orderField);
        }
        return orderField;
    }
}

